from abc import ABCMeta, abstractmethod
from v3.Error import ForbiddenError
import json


class ResultProcessor(object):
    __metaclass__ = ABCMeta

    @abstractmethod
    def process(self, page):
        pass


class DefaultResultProcessor(ResultProcessor):
    def process(self, page):
        response_text = page.get_download_result()
        res = json.loads(response_text)
        print(res)
        raise ForbiddenError(page.get_request_item())